package com.wman.lib.fragment;

import android.content.Intent;
import android.view.View;

import com.wman.sheep.common.base.BaseEvent;
import com.wman.sheep.common.utils.ToastUtil;
import com.wman.sheep.mvp.base.BaseFragment;
import com.wman.lib.R;
import com.wman.lib.delegate.TabShopCarFragmentDelegate;
import com.wman.lib.utils.callback.JsonCallback;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Name     youcai
 * Anthor   wman
 * Time     2019/08/18 0018 23:57
 * Describe 描述
 */
public class TabShopCarFragment extends BaseFragment<TabShopCarFragmentDelegate> implements
        View.OnClickListener {

    private Intent mIntent;

    private JsonCallback mJsonCallback;

    @Override
    protected Class<TabShopCarFragmentDelegate> getDelegateClass() {
        return TabShopCarFragmentDelegate.class;
    }

    @Override
    protected void bindEventListener() {
        super.bindEventListener();

        mIntent = getActivity().getIntent();

        mViewDelegate.setOnClickListener(this,
                R.id.ll_feedback
        );
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onNoDoubleClick(View v) {
        Intent intent;
        switch (v.getId()) {
            case R.id.ll_feedback:
                ToastUtil.showTextToast("DEBUG");
                break;
        }
    }

    public void reload() {
    }

    @Override
    public void onStart() {
        super.onStart();
        if (!EventBus.getDefault().isRegistered(this)) {//加上判断
            EventBus.getDefault().register(this);//事件订阅者注册,订阅者为  HouseManageActivity
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (EventBus.getDefault().isRegistered(this)) {//加上判断
            EventBus.getDefault().unregister(this);//反注册EventBus
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(BaseEvent event) {
    }
}
